<!DOCTYPE html>
<html>
<head>
<script>
    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }

    // JavaScript onbeforeunload dialogs require a user gesture.
    if (window.eventSender) {
        eventSender.mouseMoveTo(5, 5);
        eventSender.mouseDown();
        eventSender.mouseUp();
    }

    window.onload = function()
    {
        window.setTimeout("window.location.href = 'resources/notify-done.html';", 0);
    }

    window.onbeforeunload = function()
    {
        return "This is beforeunload from the top level frame.";
    }
</script>
<body>
    <p>This page registers a 'beforeunload' handler, and contains multiple IFrames that each do the same. Only the initial dialog from this top-level frame should display. The IFrame dialogs should be suppressed.</p>
    <iframe src="resources/iframe-with-beforeunload.html"></iframe>
    <iframe src="resources/iframe-with-beforeunload.html"></iframe>
</body>
</html>
